700
|
How can I filter the check-boxes (method 1)

Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Check");
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::CheckValueType;
var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exCheckValue2,TVariant(1));
var_Column->DisplayFilterButton = true;
var_Column->DisplayFilterPattern = false;
var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exCheck;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(true));
var_Items->AddItem(TVariant(true));
var_Items->AddItem(TVariant(false));
var_Items->AddItem(TVariant(true));
var_Items->AddItem(TVariant(false));
var_Items->AddItem(TVariant(true));
var_Items->AddItem(TVariant(false));
|
699
|
How can add a button to control

// ButtonClick event - Occurs when user clicks on the cell's button.
void __fastcall TForm1::Grid1ButtonClick(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant Key)
{
OutputDebugString( L"ButtonClick" );
OutputDebugString( Grid1->Items->get_CellCaption(TVariant(Item),TVariant(ColIndex)) );
OutputDebugString( L"Key" );
}
Grid1->BeginUpdate();
Grid1->DefaultItemHeight = 22;
Grid1->HeaderHeight = 22;
Grid1->Appearance = Exgridlib_tlb::AppearanceEnum::None2;
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exRowLines;
Grid1->ScrollBySingleLine = false;
Grid1->Images(TVariant(String("gBJJgBAIDAAGAAEAAQhYAf8Pf4hh0QihCJo2AEZjQAjEZFEaIEaEEaAIAkcbk0olUrlktl0vmExmUzmk1m03nE5nU7nk9n0/oFBoVDolFo1HpFJpVLplNp1PqFRqVTq") +
"lVq1XrFZrVbrldr1fsFhsVjslls1ntFptVrtltt1vuFxuVzul1u13vF5vV7vl9v1/wGBwWDwmFw2HxGJxWLxmNx0xiFdyOTh8Tf9ZymXx+QytcyNgz8r0OblWjyWds+m" +
"0ka1Vf1ta1+r1mos2xrG2xeZ0+a0W0qOx3GO4NV3WeyvD2XJ5XL5nN51aiw+lfSj0gkUkAEllHanHI5j/cHg8EZf7w8vl8j4f/qfEZeB09/vjLAB30+kZQAP/P5/H6/y" +
"NAOAEAwCjMBwFAEDwJBMDwLBYAP2/8Hv8/gAGAD8LQs9w/nhDY/oygIA="));
Grid1->HTMLPicture[L"pic1"] = TVariant("c:\\exontrol\\images\\auction.gif");
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Type");
var_Column->Width = 48;
var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"Appearance");
var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
var_Column1->Alignment = Exgridlib_tlb::AlignmentEnum::CenterAlignment;
var_Column1->HeaderAlignment = Exgridlib_tlb::AlignmentEnum::CenterAlignment;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Items.<b>CellHasButton</b> property"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Button <b>1</b>"));
var_Items->set_CellHasButton(TVariant(h),TVariant(1),true);
h = var_Items->AddItem(TVariant("Items.<b>CellButtonAutoWidth</b> property"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(" Button <b>2</b> "));
var_Items->set_CellHasButton(TVariant(h),TVariant(1),true);
var_Items->set_CellButtonAutoWidth(TVariant(h),TVariant(1),true);
h = var_Items->AddItem(TVariant("Items.<b>CellHasButton</b> property"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(" <img>2</img>Button <b>3</b> "));
var_Items->set_CellHasButton(TVariant(h),TVariant(1),true);
var_Items->set_CellButtonAutoWidth(TVariant(h),TVariant(1),true);
h = var_Items->AddItem(TVariant("Items.<b>CellHasButton</b> property"));
var_Items->set_ItemHeight(h,32);
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(" <img>2</img>Button <b>4</b> <img>pic1</img> "));
var_Items->set_CellHasButton(TVariant(h),TVariant(1),true);
var_Items->set_CellButtonAutoWidth(TVariant(h),TVariant(1),true);
h = var_Items->AddItem(TVariant("Items.<b>CellHasButton</b> in splitted cells"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(" Button <b>5.1</b> "));
var_Items->set_CellHasButton(TVariant(h),TVariant(1),true);
var_Items->set_CellButtonAutoWidth(TVariant(h),TVariant(1),true);
TVariant s = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(1)));
var_Items->set_CellValue(TVariant(0),TVariant(s),TVariant(" Button <b>5.2</b> "));
var_Items->set_CellHasButton(TVariant(0),TVariant(s),true);
var_Items->set_CellButtonAutoWidth(TVariant(0),TVariant(s),true);
h = var_Items->AddItem(TVariant("Column.<b>Editor</b>, Items.<b>CellEditor</b>"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Visible when clicking the cell"));
Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(h),TVariant(1));
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
var_Editor->AddButton(TVariant("B1"),TVariant(1),TVariant(0),TVariant("This is a bit of text that's shown when the cursor hovers the button B1"),TNoParam(),TNoParam());
var_Editor->AddButton(TVariant("B3"),TVariant(2),TVariant(1),TVariant("This is a bit of text that's shown when the cursor hovers the button B3"),TNoParam(),TNoParam());
var_Editor->AddButton(TVariant("B4"),TVariant(1),TVariant(1),TVariant("This is a bit of text that's shown when the cursor hovers the button B4"),TNoParam(),TNoParam());
var_Editor->ButtonWidth = 24;
h = var_Items->AddItem(TVariant("Column.<b>Editor</b>, Items.<b>CellEditor</b>"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(3));
Exgridlib_tlb::IEditorPtr var_Editor1 = var_Items->get_CellEditor(TVariant(h),TVariant(1));
var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::CheckListType;
var_Editor1->AddItem(1,L"Flag 1",TNoParam());
var_Editor1->AddItem(2,L"Flag 2",TNoParam());
var_Editor1->AddItem(4,L"Flag 4",TNoParam());
var_Editor1->AddItem(8,L"Flag 8",TNoParam());
var_Editor1->AddButton(TVariant("C1"),TVariant(1),TVariant(0),TVariant("This is a bit of text that's shown when the cursor hovers the button C1"),TNoParam(),TNoParam());
var_Editor1->AddButton(TVariant("C3"),TVariant(2),TVariant(0),TVariant("This is a bit of text that's shown when the cursor hovers the button C2"),TNoParam(),TNoParam());
var_Editor1->AddButton(TVariant("C4"),TVariant(1),TVariant(0),TVariant("This is a bit of text that's shown when the cursor hovers the button C3"),TNoParam(),TNoParam());
var_Editor1->ButtonWidth = 24;
Grid1->EndUpdate();
|
698
|
The item is not getting selected when clicking the cell's checkbox. What should I do

// CellStateChanged event - Fired after cell's state has been changed.
void __fastcall TForm1::Grid1CellStateChanged(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex)
{
Grid1->Items->set_SelectItem(Item,true);
}
Grid1->Columns->Add(L"Check")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(true));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(0));
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
|
697
|
Is it possible to limit the height of the item while resizing

// AddItem event - Occurs after a new Item has been inserted to Items collection.
void __fastcall TForm1::Grid1AddItem(TObject *Sender,Exgridlib_tlb::HITEM Item)
{
Grid1->Items->set_ItemMinHeight(Item,18);
Grid1->Items->set_ItemMaxHeight(Item,72);
}
Grid1->BeginUpdate();
Grid1->ItemsAllowSizing = Exgridlib_tlb::ItemsAllowSizingEnum::exResizeItem;
Grid1->ScrollBySingleLine = false;
Grid1->BackColorAlternate = RGB(240,240,240);
Grid1->Columns->Add(L"Names");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("Mantel"));
var_Items->AddItem(TVariant("Mechanik"));
var_Items->AddItem(TVariant("Motor"));
var_Items->AddItem(TVariant("Murks"));
var_Items->AddItem(TVariant("Märchen"));
var_Items->AddItem(TVariant("Möhren"));
var_Items->AddItem(TVariant("Mühle"));
Grid1->Columns->get_Item(TVariant(0))->SortOrder = Exgridlib_tlb::SortOrderEnum::SortAscending;
Grid1->EndUpdate();
|
696
|
Is it possible to copy the hierarchy of the control using the GetItems method

Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Def");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
Grid1->PutItems(Grid1->GetItems(TVariant(-1)),TNoParam());
|
695
|
Is it possible to auto-numbering the children items but still keeps the position after filtering

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Items");
var_Column->DisplayFilterButton = true;
var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilter;
var_Column->Filter = L"Child 2";
Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"Pos.1");
var_Column1->FormatColumn = L"1 ropos ''";
var_Column1->Position = 0;
var_Column1->Width = 32;
var_Column1->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column2 = Grid1->Columns->Add(L"Pos.2");
var_Column2->FormatColumn = L"1 ropos ':'";
var_Column2->Position = 1;
var_Column2->Width = 32;
var_Column2->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column3 = Grid1->Columns->Add(L"Pos.3");
var_Column3->FormatColumn = L"1 ropos ':|A-Z'";
var_Column3->Position = 2;
var_Column3->Width = 32;
var_Column3->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column4 = Grid1->Columns->Add(L"Pos.4");
var_Column4->FormatColumn = L"1 ropos '|A-Z|'";
var_Column4->Position = 3;
var_Column4->Width = 32;
var_Column4->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column5 = Grid1->Columns->Add(L"Pos.5");
var_Column5->FormatColumn = L"'<font Tahoma;7>' + 1 ropos '-<b>||A-Z'";
var_Column5->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
var_Column5->Position = 4;
var_Column5->Width = 32;
var_Column5->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column6 = Grid1->Columns->Add(L"Pos.6");
var_Column6->FormatColumn = L"'<b>'+ 1 ropos '</b>:<fgcolor=FF0000>|A-Z|'";
var_Column6->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
var_Column6->Position = 5;
var_Column6->Width = 48;
var_Column6->AllowSizing = false;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
Grid1->ApplyFilter();
Grid1->EndUpdate();
|
694
|
Is it possible to auto-numbering the children items too

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Pos.1");
var_Column->FormatColumn = L"1 rpos ''";
var_Column->Position = 0;
var_Column->Width = 32;
var_Column->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"Pos.2");
var_Column1->FormatColumn = L"1 rpos ':'";
var_Column1->Position = 1;
var_Column1->Width = 32;
var_Column1->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column2 = Grid1->Columns->Add(L"Pos.3");
var_Column2->FormatColumn = L"1 rpos ':|A-Z'";
var_Column2->Position = 2;
var_Column2->Width = 32;
var_Column2->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column3 = Grid1->Columns->Add(L"Pos.4");
var_Column3->FormatColumn = L"1 rpos '|A-Z|'";
var_Column3->Position = 3;
var_Column3->Width = 32;
var_Column3->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column4 = Grid1->Columns->Add(L"Pos.5");
var_Column4->FormatColumn = L"'<font Tahoma;7>' + 1 rpos '-<b>||A-Z'";
var_Column4->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
var_Column4->Position = 4;
var_Column4->Width = 32;
var_Column4->AllowSizing = false;
Exgridlib_tlb::IColumnPtr var_Column5 = Grid1->Columns->Add(L"Pos.6");
var_Column5->FormatColumn = L"'<b>'+ 1 rpos '</b>:<fgcolor=FF0000>|A-Z|'";
var_Column5->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
var_Column5->Position = 5;
var_Column5->Width = 48;
var_Column5->AllowSizing = false;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
Grid1->EndUpdate();
|
693
|
Is it possible to cancel or discard the values during validation

// ValidateValue event - Occurs before user changes the cell's value.
void __fastcall TForm1::Grid1ValidateValue(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant NewValue,VARIANT_BOOL * Cancel)
{
OutputDebugString( L"ValidateValue" );
OutputDebugString( L"NewValue" );
OutputDebugString( L"Change the Cancel parameter for ValidateValue event to accept/decline the newly value. " );
OutputDebugString( L"The DiscardValidateValue restores back the previously values." );
Grid1->DiscardValidateValue();
}
Grid1->BeginUpdate();
Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateCell;
Grid1->Columns->Add(L"Date")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType;
Grid1->Columns->Add(L"Text")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
Grid1->EndUpdate();
|
692
|
Is it possible to validate the values of the cells only when user leaves the focused item
// ValidateValue event - Occurs before user changes the cell's value.
void __fastcall TForm1::Grid1ValidateValue(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant NewValue,VARIANT_BOOL * Cancel)
{
OutputDebugString( L"ValidateValue" );
OutputDebugString( L"NewValue" );
OutputDebugString( L"Change the Cancel parameter for ValidateValue event to accept/decline the newly value. " );
Cancel = true;
OutputDebugString( L"You can not leave the item/record until the Cancel is False." );
}
Grid1->BeginUpdate();
Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateItem;
Grid1->Columns->Add(L"Date")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType;
Grid1->Columns->Add(L"Text")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
Grid1->EndUpdate();
|
691
|
We would like to validate the values of the cells. Is it possible

// ValidateValue event - Occurs before user changes the cell's value.
void __fastcall TForm1::Grid1ValidateValue(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant NewValue,VARIANT_BOOL * Cancel)
{
OutputDebugString( L"ValidateValue" );
OutputDebugString( L"NewValue" );
OutputDebugString( L"Change the Cancel parameter for ValidateValue event to accept/decline the newly value." );
Cancel = true;
OutputDebugString( L"You can not leave the cell until the Cancel is False." );
}
Grid1->BeginUpdate();
Grid1->CauseValidateValue = Exgridlib_tlb::ValidateValueType::exValidateCell;
Grid1->Columns->Add(L"Date")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::DateType;
Grid1->Columns->Add(L"Text")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()))),TVariant(1),TVariant("text"));
Grid1->EndUpdate();
|
690
|
Is there any way to add auto-numbering

Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Items");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Pos");
var_Column->FormatColumn = L"1 pos ''";
var_Column->Position = 0;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("Item 1"));
var_Items->AddItem(TVariant("Item 2"));
var_Items->AddItem(TVariant("Item 3"));
|
689
|
Does your control supports multiple lines tooltip

Grid1->HTMLPicture[L"pic1"] = TVariant("c:\\exontrol\\images\\zipdisk.gif");
Grid1->ToolTipDelay = 1;
Grid1->Columns->Add(L"tootip")->ToolTip = TVariant(String("<br><font Tahoma;10>This</font> is a <b>multi-lines</b> tooltip assigned to a column. The tooltip supports built-in HTML tags, ") +
"icons and pictures.<br><br><br><img>pic1</img> picture ... <br><br>");
|
688
|
How can I prevent highlighting the column from the cursor - point

Grid1->VisualAppearance->Add(1,TVariant(String("gBFLBCJwBAEHhEJAEGg4BI0IQAAYAQGKIYBkAKBQAGaAoDDUOQzQwAAxDKKUEwsACEIrjKCYVgOHYYRrIMYgBCMJhLEoaZLhEZRQiqDYtRDFQBSDDcPw/EaRZohGaYJ") +
"gEgI="));
Grid1->Background[Exgridlib_tlb::BackgroundPartEnum::exCursorHoverColumn] = 0x1000000;
Grid1->Columns->Add(L"S")->Width = 32;
Grid1->Columns->Add(L"Level 1")->set_LevelKey(TVariant(1));
Grid1->Columns->Add(L"Level 2")->set_LevelKey(TVariant(1));
Grid1->Columns->Add(L"Level 3")->set_LevelKey(TVariant(1));
Grid1->Columns->Add(L"E1")->Width = 32;
Grid1->Columns->Add(L"E2")->Width = 32;
Grid1->Columns->Add(L"E3")->Width = 32;
Grid1->Columns->Add(L"E4")->Width = 32;
|
687
|
Is it possible display numbers in the same format no matter of regional settings in the control panel

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default positive)'");
h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '2|.|3|,|1|1')");
h = var_Items->AddItem(TVariant(-100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default negative)'");
h = var_Items->AddItem(TVariant(-100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '2|.|3|,|1|1')");
Grid1->EndUpdate();
|
686
|
Is it possible to add a 0 for numbers less than 1 instead .7 to show 0.8

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(0.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(0.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '|||||0') + ' <fgcolor=808080>(Display no leading zeros)'");
Grid1->EndUpdate();
|
685
|
How can I specify the format for negative numbers

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(-100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(-100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '||||1') + ' <fgcolor=808080>(Negative sign, number; for example, -1.1)'");
Grid1->EndUpdate();
|
684
|
Is it possible to change the grouping character when display numbers

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '|||-') + ' <fgcolor=808080>(grouping character is -)'");
Grid1->EndUpdate();
|
683
|
How can I display numbers with 2 digits in each group

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(100000.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '||2') + ' <fgcolor=808080>(grouping by 2 digits)'");
Grid1->EndUpdate();
|
682
|
How can I display my numbers using a different decimal separator

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '|;') + ' <fgcolor=808080>(decimal separator is <b>;</b>)'");
Grid1->EndUpdate();
|
681
|
Is it possible to display the numbers using 3 (three) digits

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '') + ' <fgcolor=808080>(default)'");
h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format '3') + ' <fgcolor=808080>(3 digits)'");
h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format 2) + ' <fgcolor=808080>(2 digits)'");
h = var_Items->AddItem(TVariant(100.27));
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"(value format 1) + ' <fgcolor=808080>(1 digit)'");
Grid1->EndUpdate();
|
680
|
Is there any option to show the tooltip programmatically

// MouseMove event - Occurs when the user moves the mouse.
void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y)
{
Grid1->ShowToolTip(PChar(Grid1->ItemFromPoint[-1,-1,c,hit]),TVariant(""),TVariant("8"),TVariant("8"),TNoParam());
}
Grid1->BeginUpdate();
Grid1->Columns->Add(L"Def");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("Item 1"));
var_Items->AddItem(TVariant("Item 2"));
var_Items->AddItem(TVariant("Item 3"));
Grid1->EndUpdate();
|
679
|
How can I specify the column's width to be the same for all columns

Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"A");
var_Columns->Add(L"B");
var_Columns->Add(L"C");
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
Grid1->ColumnAutoResize = true;
|
678
|
How can I set the column's width to my desired width

Grid1->ColumnAutoResize = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"A")->Width = 128;
var_Columns->Add(L"B")->Width = 128;
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
|
677
|
Is it possible to format numbers

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"A");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column->AllowSizing = false;
var_Column->Width = 36;
var_Column->FormatColumn = L"len(value) ? value + ' +'";
var_Column->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"B");
var_Column1->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column1->AllowSizing = false;
var_Column1->Width = 36;
var_Column1->FormatColumn = L"len(value) ? value + ' +'";
var_Column1->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"C");
var_Column2->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column2->AllowSizing = false;
var_Column2->Width = 36;
var_Column2->FormatColumn = L"len(value) ? value + ' ='";
var_Column2->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column3 = var_Columns->Add(L"A+B+C");
var_Column3->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column3->Width = 64;
var_Column3->ComputedField = L"dbl(%1)+dbl(%2)+dbl(%3)";
var_Column3->FormatColumn = TVariant(String("type(value) in (0,1) ? 'null' : ( dbl(value)<0 ? '<fgcolor=FF0000>'+ (value format '2|.|3|,|1' ) : (dbl(value)>0 ? '<fgcolor=00") +
"00FF>+'+(value format '2|.|3|,' ): '0.00') )");
var_Column3->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(4),Exgridlib_tlb::ValueFormatEnum::exComputedField);
long h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(7));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(3));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(1));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(-2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(-2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(-4));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(-4));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
676
|
How can I collapse all items

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(0,false);
Grid1->EndUpdate();
|
675
|
How can I expand all items

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(0,true);
Grid1->EndUpdate();
|
674
|
Can I display a total field without having to add a child item

Grid1->BeginUpdate();
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Numbers");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exFloat;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exBottom,1);
long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exBottom,0);
var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("sum(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'SUM: '+value");
Grid1->EndUpdate();
|
673
|
Can I display the number of child items

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exGroupLinesAtRoot;
Grid1->Columns->Add(L"");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
TVariant hx = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0)));
var_Items->set_CellValue(TVariant(0),TVariant(hx),TVariant("count(current,dir,1)"));
var_Items->set_CellValueFormat(TVariant(0),TVariant(hx),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_FormatCell(TVariant(0),TVariant(hx),L"'Childs: ' + value");
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Root 2"));
hx = TVariant(var_Items->get_SplitCell(TVariant(h),TVariant(0)));
var_Items->set_CellValue(TVariant(0),TVariant(hx),TVariant("count(current,dir,1)"));
var_Items->set_CellValueFormat(TVariant(0),TVariant(hx),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_FormatCell(TVariant(0),TVariant(hx),L"'Childs: ' + value");
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 4"));
Grid1->EndUpdate();
|
672
|
My field does not display the correctly computed value if I enter data using the control's editors ( concatenation of strings ). What am I doing wrong

Grid1->BeginUpdate();
Grid1->Columns->Add(L"T");
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"A")->Editor;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IEditorPtr var_Editor1 = Grid1->Columns->Add(L"B")->Editor;
var_Editor1->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Grid1->Columns->Add(L"A+B");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Incorrect"));
var_Items->set_CellToolTip(TVariant(h),TVariant(0),L"Just type a number in the column A or B. The result will be concaternated");
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("10"));
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("20"));
var_Items->set_CellValue(TVariant(h),TVariant(3),TVariant("currency(%1+%2)"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(3),Exgridlib_tlb::ValueFormatEnum::exComputedField);
h = var_Items->AddItem(TVariant("Correct"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(10));
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant(20));
var_Items->set_CellValue(TVariant(h),TVariant(3),TVariant("currency(dbl(%1)+dbl(%2))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(3),Exgridlib_tlb::ValueFormatEnum::exComputedField);
Grid1->EndUpdate();
|
671
|
The CellValue/CellCaption property gets the result of a computed/total field with text formatting. Is it possible to get that value without text formatting

Grid1->BeginUpdate();
Grid1->Columns->Add(L"A")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Grid1->Columns->Add(L"B")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Grid1->Columns->Add(L"A+B");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(10));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(20));
var_Items->set_CellValueFormat(TVariant(h),TVariant(2),Exgridlib_tlb::ValueFormatEnum::exComputedField);
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("currency(dbl(%0)+dbl(%1))"));
OutputDebugString( L"CellCaption returns " );
OutputDebugString( var_Items->get_CellCaption(TVariant(h),TVariant(2)) );
OutputDebugString( L"CellValue returns " );
OutputDebugString( PChar(var_Items->get_CellValue(TVariant(h),TVariant(2))) );
OutputDebugString( L"ComputeValue returns " );
OutputDebugString( PChar(var_Items->get_ComputeValue(TVariant("dbl(%0)+dbl(%1)"),TVariant(h),TVariant(0),TVariant(var_Items->get_CellValueFormat(TVariant(h),TVariant(2))))) );
Grid1->EndUpdate();
|
670
|
Can I get the result of a specified formula as your control does using the ComputedField property
Grid1->BeginUpdate();
Grid1->Columns->Add(L"A");
Grid1->Columns->Add(L"B");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(10));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(20));
OutputDebugString( L"A+B is " );
OutputDebugString( PChar(var_Items->get_ComputeValue(TVariant("dbl(%0)+dbl(%1)"),TVariant(h),TVariant(0),TVariant(2))) );
Grid1->EndUpdate();
|
669
|
Is it possible to get the text without HTML formatting

Grid1->BeginUpdate();
Grid1->Columns->Add(L"");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("<b>bold</b>"));
OutputDebugString( PChar(var_Items->get_ComputeValue(TVariant(var_Items->get_CellValue(TVariant(h),TVariant(0))),TVariant(h),TVariant(0),TVariant(1))) );
Grid1->EndUpdate();
|
668
|
Can I specify an item to be a separator

Grid1->BeginUpdate();
Grid1->TreeColumnIndex = -1;
Grid1->SortOnClick = Exgridlib_tlb::SortOnClickEnum::exNoSort;
Grid1->Columns->Add(L"Numbers");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
long h = var_Items->AddItem(TVariant("separator"));
var_Items->set_SelectableItem(h,false);
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemDividerLine(h,Exgridlib_tlb::DividerLineEnum::ThinLine);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::CenterAlignment);
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
Grid1->EndUpdate();
|
667
|
How can I count only non-zero values

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(0));
var_Items->AddItem(TVariant(0));
var_Items->AddItem(TVariant(0));
var_Items->AddItem(TVariant(0));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("sum(all,dir,dbl(%0)?1:0)"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'COUNT non-zero: '+value");
Grid1->EndUpdate();
|
666
|
How can I add a AVG ( average ) field

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("avg(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'AVG: '+value");
Grid1->EndUpdate();
|
665
|
How can I add a COUNT field

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("count(all,dir,0)"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'COUNT: '+value");
Grid1->EndUpdate();
|
664
|
How can I add a MAX field

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("max(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MAX: '+value");
Grid1->EndUpdate();
|
663
|
How can I add a MIN or MAX field (for numbers)

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(11));
var_Items->AddItem(TVariant(21));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("min(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MIN: '+value");
h = var_Items->AddItem(TVariant("max(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'MAX: '+value");
Grid1->EndUpdate();
|
662
|
How can I add a SUM field

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("sum(all,dir,dbl(%0))"));
var_Items->set_SortableItem(h,false);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'SUM: '+value");
Grid1->EndUpdate();
|
661
|
How can I add total and subtotals fields

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exGroupLinesAtRoot;
Grid1->Columns->Add(L"Members");
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Values");
var_Column->FormatColumn = L"currency(value)";
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Group 1"));
var_Items->set_ItemBold(h,true);
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("sum(current,dir,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_CellHAlignment(TVariant(h),TVariant(1),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(10));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(20));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(30));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Group 2"));
var_Items->set_ItemBold(h,true);
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("sum(current,dir,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_CellHAlignment(TVariant(h),TVariant(1),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(5));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(15));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(35));
h = var_Items->AddItem(TVariant("total"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("sum(all,rec,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_FormatCell(TVariant(h),TVariant(1),L"'Total: <b>' + currency(value)");
var_Items->set_CellHAlignment(TVariant(h),TVariant(1),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_ItemDivider(h,1);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemDividerLine(h,Exgridlib_tlb::DividerLineEnum::DoubleLine);
var_Items->set_SortableItem(h,false);
Grid1->EndUpdate();
|
660
|
Is is possible to have subtotal items, and a grand total item

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->BeginUpdate();
Grid1->BackColor = RGB(255,255,255);
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exGroupLinesAtRoot;
Grid1->ShowFocusRect = false;
Grid1->Columns->Add(L"Members");
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Values");
var_Column->FormatColumn = L"currency(value)";
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Group 1"));
var_Items->set_ItemBold(h,true);
var_Items->set_SortableItem(h,false);
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_FormatCell(TVariant(h),TVariant(1),L" ");
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(10));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(20));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(30));
long hT = var_Items->InsertItem(h,TNoParam(),TVariant("subtotal"));
var_Items->set_CellHAlignment(TVariant(hT),TVariant(1),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_CellEditorVisible(TVariant(hT),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValue(TVariant(hT),TVariant(1),TVariant("sum(parent,dir,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(hT),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_FormatCell(TVariant(hT),TVariant(1),L"'subtotal: <b>' + currency(value)");
var_Items->set_ItemDivider(hT,1);
var_Items->set_ItemDividerLineAlignment(hT,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_SortableItem(hT,false);
var_Items->set_SelectableItem(hT,false);
var_Items->set_ItemDividerLine(hT,Exgridlib_tlb::DividerLineEnum::DotLine);
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Group 2"));
var_Items->set_ItemBold(h,true);
var_Items->set_SortableItem(h,false);
var_Items->set_FormatCell(TVariant(h),TVariant(1),L" ");
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(15));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(25));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(18));
hT = var_Items->InsertItem(h,TNoParam(),TVariant("subtotal"));
var_Items->set_CellHAlignment(TVariant(hT),TVariant(1),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_CellEditorVisible(TVariant(hT),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValue(TVariant(hT),TVariant(1),TVariant("sum(parent,dir,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(hT),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_FormatCell(TVariant(hT),TVariant(1),L"'subtotal: <b>' + currency(value)");
var_Items->set_ItemDivider(hT,1);
var_Items->set_ItemDividerLineAlignment(hT,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemDividerLine(hT,Exgridlib_tlb::DividerLineEnum::DotLine);
var_Items->set_SortableItem(hT,false);
var_Items->set_SelectableItem(hT,false);
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("total"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("sum(all,rec,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_CellEditorVisible(TVariant(h),TVariant(1),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_FormatCell(TVariant(h),TVariant(1),L"'Total: <b><font ;11>' + currency(value)");
var_Items->set_CellHAlignment(TVariant(h),TVariant(1),Exgridlib_tlb::AlignmentEnum::CenterAlignment);
var_Items->set_ItemDivider(h,1);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemDividerLine(h,Exgridlib_tlb::DividerLineEnum::DoubleLine);
var_Items->set_SortableItem(h,false);
var_Items->set_SelectableItem(h,false);
Grid1->EndUpdate();
|
659
|
Is it possible to have a total field for each column

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->BeginUpdate();
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"C1");
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->Add(L"C2");
Exgridlib_tlb::IEditorPtr var_Editor1 = var_Column1->Editor;
var_Editor1->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
var_Editor1->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Column1->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exBottom,1);
long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exBottom,0);
var_Items->set_ItemBackColor(h,RGB(240,240,240));
var_Items->set_ItemBold(h,true);
var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("sum(all,dir,dbl(%0))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("sum(all,dir,dbl(%1))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exTotalField);
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(10))),TVariant(1),TVariant(12));
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(25))),TVariant(1),TVariant(5));
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(31))),TVariant(1),TVariant(17));
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(48))),TVariant(1),TVariant(22));
Grid1->EndUpdate();
|
658
|
How can I add a total field for a DataSource being used

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->ColumnAutoResize = false;
Grid1->ContinueColumnScroll = false;
/*
Select the Component\Import Component...\Import a Type Library,
to import the following Type Library:
Microsoft ActiveX Data Objects 6.1 Library
TypeLib: msado15.dll
to define the namespace: Adodb_tlb
*/
//#include "ADODB_TLB.h"
Adodb_tlb::_RecordsetPtr rs = Variant::CreateObject(L"ADOR.Recordset");
rs->Open(TVariant("Orders"),TVariant("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExGrid\\Sample\\Access\\misc.accdb"),Adodb_tlb::CursorTypeEnum::adOpenStatic,Adodb_tlb::LockTypeEnum::adLockOptimistic,0);
Grid1->DataSource = (IDispatch*)rs;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exTop,1);
long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exTop,0);
var_Items->set_ItemDivider(h,0);
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("sum(all,dir,%1)"));
|
657
|
How can I add a total field

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->BeginUpdate();
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->Add(L"Numbers");
Exgridlib_tlb::IEditorPtr var_Editor = var_Column->Editor;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_LockedItemCount(Exgridlib_tlb::VAlignmentEnum::exTop,1);
long h = var_Items->get_LockedItem(Exgridlib_tlb::VAlignmentEnum::exTop,0);
var_Items->set_ItemBackColor(h,RGB(240,240,240));
var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant("sum(all,dir,dbl(%0))"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_FormatCell(TVariant(h),TVariant(0),L"'Total: '+value");
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
var_Items1->AddItem(TVariant(10));
var_Items1->AddItem(TVariant(25));
var_Items1->AddItem(TVariant(31));
var_Items1->AddItem(TVariant(48));
Grid1->EndUpdate();
|
656
|
How can I add a total field

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Grid1->Refresh();
}
Grid1->BeginUpdate();
Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Items")->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
var_Editor->Numeric = Exgridlib_tlb::NumericEnum::exInteger;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Group 1"));
var_Items->set_CellEditorVisible(TVariant(h),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->InsertItem(h,TNoParam(),TVariant(10));
var_Items->InsertItem(h,TNoParam(),TVariant(20));
var_Items->InsertItem(h,TNoParam(),TVariant(30));
long hT = var_Items->InsertItem(h,TNoParam(),TVariant("sum(parent,dir,dbl(%0))"));
var_Items->set_CellEditorVisible(TVariant(hT),TVariant(0),Exgridlib_tlb::EditorVisibleEnum::exEditorHidden);
var_Items->set_CellValueFormat(TVariant(hT),TVariant(0),Exgridlib_tlb::ValueFormatEnum::exTotalField | Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_ItemDivider(hT,0);
var_Items->set_ItemDividerLineAlignment(hT,Exgridlib_tlb::DividerAlignmentEnum::DividerTop);
var_Items->set_SelectableItem(hT,false);
var_Items->set_SortableItem(hT,false);
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
655
|
Is it possible to specify the cell's value but still want to display some formatted text instead the value

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Value");
Grid1->Columns->Add(L"FormatCell");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(1));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(12));
var_Items->set_FormatCell(TVariant(h),TVariant(1),L"currency(value)");
h = var_Items->AddItem(TVariant(TDateTime(2001,1,1).operator double()));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(TDateTime(2001,1,1).operator double()));
var_Items->set_CellValueFormat(TVariant(h),TVariant(1),Exgridlib_tlb::ValueFormatEnum::exHTML);
var_Items->set_FormatCell(TVariant(h),TVariant(1),L"longdate(value) replace '2001' with '<b>2001</b>'");
Grid1->EndUpdate();
|
654
|
How can I simulate displaying groups

Grid1->HasLines = Exgridlib_tlb::HierarchyLineEnum::exNoLine;
Grid1->ScrollBySingleLine = true;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
var_Columns->Add(L"A");
var_Columns->Add(L"B");
var_Columns->Add(L"C");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Group 1"));
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::CenterAlignment);
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerBoth);
var_Items->set_ItemHeight(h,24);
var_Items->set_SortableItem(h,false);
long h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(1));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(3));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(4));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(5));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(6));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Group 2"));
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::CenterAlignment);
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerBoth);
var_Items->set_ItemHeight(h,24);
var_Items->set_SortableItem(h,false);
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(1));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(3));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(4));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(5));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(6));
var_Items->set_ExpandItem(h,true);
|
653
|
Is it possible to specify the cell's value but still want to display some formatted text instead the value

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Values");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column->AllowSizing = false;
var_Column->Width = 64;
var_Column->FormatColumn = L"((0:=dbl(value)) < 10? '<fgcolor=808080><font ;7>' :'<b>') + currency(=:0)";
var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->set_FormatCell(TVariant(h),TVariant(1),L"'<none>'");
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(10));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(15));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(25));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
652
|
I am using the FormatColumn to display the current currency, but would like hide some values. Is it possible

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Values");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column->AllowSizing = false;
var_Column->Width = 64;
var_Column->FormatColumn = L"((0:=dbl(value)) < 10? '<fgcolor=808080><font ;7>' :'<b>') + currency(=:0)";
var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->set_FormatCell(TVariant(h),TVariant(1),L" ");
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"))),TVariant(1),TVariant(10));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"))),TVariant(1),TVariant(15));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"))),TVariant(1),TVariant(25));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
651
|
How can I specify an item to be always the first item

Grid1->BeginUpdate();
Grid1->TreeColumnIndex = -1;
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("first"));
var_Items->set_ItemPosition(h,0);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_SortableItem(h,false);
var_Items->SortChildren(0,TVariant(0),false);
Grid1->EndUpdate();
|
650
|
How can I specify an item to be always the last item

Grid1->BeginUpdate();
Grid1->TreeColumnIndex = -1;
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("last"));
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_SortableItem(h,false);
var_Items->SortChildren(0,TVariant(0),true);
Grid1->EndUpdate();
|
649
|
Can I allow sorting only the child items

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Childs");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->set_SortableItem(h,false);
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->set_SortableItem(h,false);
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
648
|
Can I specify a terminal item so it will mark the end of childs

Grid1->BeginUpdate();
Grid1->ScrollBySingleLine = true;
Grid1->Columns->Add(L"P1");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->InsertItem(h,TVariant(""),TVariant(""));
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemHeight(h,2);
var_Items->set_SelectableItem(h,false);
var_Items->set_SortableItem(h,false);
h = var_Items->AddItem(TVariant("Root 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->InsertItem(h,TVariant(""),TVariant(""));
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemDividerLineAlignment(h,Exgridlib_tlb::DividerAlignmentEnum::DividerCenter);
var_Items->set_ItemHeight(h,2);
var_Items->set_SelectableItem(h,false);
var_Items->set_SortableItem(h,false);
Grid1->EndUpdate();
|
647
|
Is it possible to specify an item being unsortable so its position won't be changed after sorting

Grid1->BeginUpdate();
Grid1->TreeColumnIndex = -1;
Grid1->Columns->Add(L"Numbers")->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(1));
var_Items->AddItem(TVariant(2));
var_Items->AddItem(TVariant(3));
var_Items->AddItem(TVariant(4));
long h = var_Items->AddItem(TVariant("top 3"));
var_Items->set_ItemPosition(h,3);
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::RightAlignment);
var_Items->set_SortableItem(h,false);
var_Items->SortChildren(0,TVariant(0),false);
Grid1->EndUpdate();
|
646
|
Is it possible to move an item from a parent to another

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("A"));
var_Items->AddItem(TVariant("B"));
var_Items->InsertItem(var_Items->AddItem(TVariant("C")),TVariant(""),TVariant("D"));
var_Items->SetParent(var_Items->get_FindItem(TVariant("D"),TVariant(0),TNoParam()),var_Items->get_FindItem(TVariant("A"),TVariant(0),TNoParam()));
Grid1->EndUpdate();
|
645
|
How can I change the identation for an item

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("A"));
var_Items->AddItem(TVariant("B"));
var_Items->InsertItem(var_Items->AddItem(TVariant("C")),TVariant(""),TVariant("D"));
var_Items->SetParent(var_Items->get_FindItem(TVariant("D"),TVariant(0),TNoParam()),0);
Grid1->EndUpdate();
|
644
|
How can I arrange the control's header on multiple levels

Grid1->BeginUpdate();
Grid1->DefaultItemHeight = 48;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Title")->Visible = false;
var_Columns->Add(L"FirstName")->Visible = false;
var_Columns->Add(L"LastName")->Visible = false;
var_Columns->Add(L"Photo")->Visible = false;
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Address");
var_Column->Visible = false;
var_Column->set_Def(Exgridlib_tlb::DefColumnEnum::exCellSingleLine,TVariant(false));
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"Personal Info");
var_Column1->FormatLevel = L"3:48,(0/1/2),4:96";
var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellFormatLevel,TVariant("3:48,(0/1/2),4:96"));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("Nancy"));
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("Davolio"));
var_Items->set_CellPicture(TVariant(h),TVariant(3),Grid1->ExecuteTemplate("loadpicture(`c:\\exontrol\\images\\zipdisk.gif`)"));
var_Items->set_CellValue(TVariant(h),TVariant(4),TVariant("507-20th Ave. E.Apt. 2A"));
Grid1->EndUpdate();
|
643
|
How can I filter programatically using more columns

Grid1->BeginUpdate();
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Car");
var_Columns->Add(L"Equipment");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Mazda"))),TVariant(1),TVariant("Air Bag"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Toyota"))),TVariant(1),TVariant("Air Bag,Air condition"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Ford"))),TVariant(1),TVariant("Air condition"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Nissan"))),TVariant(1),TVariant("Air Bag,ABS,ESP"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Mazda"))),TVariant(1),TVariant("Air Bag, ABS,ESP"));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant("Mazda"))),TVariant(1),TVariant("ABS,ESP"));
Exgridlib_tlb::IColumnPtr var_Column = Grid1->Columns->get_Item(TVariant("Car"));
var_Column->FilterType = Exgridlib_tlb::FilterTypeEnum::exFilter;
var_Column->Filter = L"Mazda";
Exgridlib_tlb::IColumnPtr var_Column1 = Grid1->Columns->get_Item(TVariant("Equipment"));
var_Column1->FilterType = Exgridlib_tlb::FilterTypeEnum::exPattern;
var_Column1->Filter = L"*ABS*|*ESP*";
Grid1->ApplyFilter();
Grid1->EndUpdate();
|
642
|
How can I show the ticks for a single slider field

Grid1->BeginUpdate();
Grid1->Columns->Add(L"Slider")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SliderType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant(10));
Exgridlib_tlb::IEditorPtr var_Editor = var_Items->get_CellEditor(TVariant(var_Items->AddItem(TVariant(20))),TVariant(0));
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SliderType;
var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exSliderTickFrequency,TVariant(10));
var_Items->AddItem(TVariant(30));
Grid1->EndUpdate();
|
641
|
Is it possible to show ticks for slider fields

Exgridlib_tlb::IEditorPtr var_Editor = Grid1->Columns->Add(L"Slider")->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SliderType;
var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exSliderTickFrequency,TVariant(10));
Grid1->Items->AddItem(TVariant(10));
|
640
|
Is it possible to colour a particular column, I mean the cell's foreground color

Grid1->BeginUpdate();
Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat = Grid1->ConditionalFormats->Add(L"1",TNoParam());
var_ConditionalFormat->ForeColor = RGB(255,0,0);
var_ConditionalFormat->ApplyTo = Exgridlib_tlb::FormatApplyToEnum(0x1);
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Column 1");
var_Columns->Add(L"Column 2");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(0))),TVariant(1),TVariant(1));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(2))),TVariant(1),TVariant(3));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(4))),TVariant(1),TVariant(5));
Grid1->EndUpdate();
|
639
|
Is it possible to colour a particular column for specified values

Grid1->BeginUpdate();
Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat = Grid1->ConditionalFormats->Add(L"int(%1) in (3,4,5)",TNoParam());
var_ConditionalFormat->BackColor = RGB(255,0,0);
var_ConditionalFormat->ApplyTo = Exgridlib_tlb::FormatApplyToEnum(0x1);
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Column 1");
var_Columns->Add(L"Column 2");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(0))),TVariant(1),TVariant(1));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(2))),TVariant(1),TVariant(3));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(4))),TVariant(1),TVariant(5));
Grid1->EndUpdate();
|
638
|
Is it possible to colour a particular column

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Column 1");
var_Columns->Add(L"Column 2")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellBackColor,TVariant(255));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(0))),TVariant(1),TVariant(1));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(2))),TVariant(1),TVariant(3));
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(4))),TVariant(1),TVariant(5));
Grid1->EndUpdate();
|
637
|
How do i get all the children items that are under a certain parent Item handle
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"P");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_ExpandItem(h,true);
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
long hChild = var_Items1->get_ItemChild(var_Items1->FirstVisibleItem);
OutputDebugString( PChar(var_Items1->get_CellValue(TVariant(hChild),TVariant(0))) );
OutputDebugString( PChar(var_Items1->get_CellValue(TVariant(var_Items1->get_NextSiblingItem(hChild)),TVariant(0))) );
Grid1->EndUpdate();
|
636
|
Is is possible to use HTML tags to display in the filter caption

Grid1->BeginUpdate();
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarCaption = L"This is a bit of text being displayed in the filter bar.";
Grid1->Columns->Add(L"");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("Item 1"));
var_Items->AddItem(TVariant("Item 2"));
var_Items->AddItem(TVariant("Item 3"));
Grid1->EndUpdate();
|
635
|
How can I find the number of items after filtering
Grid1->BeginUpdate();
Grid1->Columns->Add(L"");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(""));
var_Items->set_CellValue(TVariant(h),TVariant(0),TVariant(var_Items->VisibleItemCount));
Grid1->EndUpdate();
|
634
|
How can I change the filter caption

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptWords | Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAll;
Grid1->FilterBarPromptPattern = L"london robert";
Grid1->FilterBarCaption = L"<r>Found: ... ";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
633
|
While using the filter prompt is it is possible to use wild characters

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptPattern;
Grid1->FilterBarPromptPattern = L"lon* seat*";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
632
|
How can I list all items that contains any of specified words, not necessary at the beggining

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptStartWords | Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAny;
Grid1->FilterBarPromptPattern = L"london davolio";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
631
|
How can I list all items that contains any of specified words, not strings

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptWords | Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAny;
Grid1->FilterBarPromptPattern = L"london nancy";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
630
|
How can I list all items that contains all specified words, not strings

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptWords | Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAll;
Grid1->FilterBarPromptPattern = L"london robert";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
629
|
I've noticed that the filtering by prompt is not case sensitive, is is possible to make it case sensitive

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptCaseSensitive | Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAny;
Grid1->FilterBarPromptPattern = L"Anne";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
628
|
Is it possible to list only items that ends with any of specified strings

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptEndWith;
Grid1->set_FilterBarPromptColumns(TVariant("0"));
Grid1->FilterBarPromptPattern = L"Fuller";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
627
|
Is it possible to list only items that ends with any of specified strings

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptEndWith;
Grid1->set_FilterBarPromptColumns(TVariant("0"));
Grid1->FilterBarPromptPattern = L"Fuller";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
626
|
Is it possible to list only items that starts with any of specified strings

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptStartWith;
Grid1->set_FilterBarPromptColumns(TVariant("0"));
Grid1->FilterBarPromptPattern = L"An M";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
625
|
Is it possible to list only items that starts with specified string

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptStartWith;
Grid1->set_FilterBarPromptColumns(TVariant("0"));
Grid1->FilterBarPromptPattern = L"A";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
624
|
How can I specify that the list should include any of the seqeunces in the pattern

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAny;
Grid1->FilterBarPromptPattern = L"london seattle";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
623
|
How can I specify that all sequences in the filter pattern must be included in the list

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptType = Exgridlib_tlb::FilterPromptEnum::exFilterPromptContainsAll;
Grid1->FilterBarPromptPattern = L"london manager";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
622
|
How do I change at runtime the filter prompt

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPromptPattern = L"london manager";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
621
|
How do I specify to filter only a single column when using the filter prompt

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->set_FilterBarPromptColumns(TVariant("2,3"));
Grid1->FilterBarPromptPattern = L"london";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
620
|
How do I change the prompt or the caption being displayed in the filter bar

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Grid1->FilterBarPrompt = L"changed";
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Grid1->EndUpdate();
|
619
|
How do I enable the filter prompt feature

Grid1->BeginUpdate();
Grid1->ColumnAutoResize = true;
Grid1->ContinueColumnScroll = false;
Grid1->FocusColumnIndex = 1;
Grid1->MarkSearchColumn = false;
Grid1->SearchColumnIndex = 1;
Grid1->FilterBarPromptVisible = Exgridlib_tlb::FilterBarVisibleEnum::exFilterBarPromptVisible;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name")->Width = 96;
var_Columns->Add(L"Title")->Width = 96;
var_Columns->Add(L"City");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h0 = var_Items->AddItem(TVariant("Nancy Davolio"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Andrew Fuller"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Vice President, Sales"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Tacoma"));
var_Items->set_SelectItem(h0,true);
h0 = var_Items->AddItem(TVariant("Janet Leverling"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Kirkland"));
h0 = var_Items->AddItem(TVariant("Margaret Peacock"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Redmond"));
h0 = var_Items->AddItem(TVariant("Steven Buchanan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Manager"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Michael Suyama"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Robert King"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
h0 = var_Items->AddItem(TVariant("Laura Callahan"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Inside Sales Coordinator"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("Seattle"));
h0 = var_Items->AddItem(TVariant("Anne Dodsworth"));
var_Items->set_CellValue(TVariant(h0),TVariant(1),TVariant("Sales Representative"));
var_Items->set_CellValue(TVariant(h0),TVariant(2),TVariant("London"));
Grid1->EndUpdate();
|
618
|
How can I control the colors that can be applied to an EBN part

// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_ItemBackColor(var_Items->FirstVisibleItem,NewValue);
}
Grid1->BeginUpdate();
Exgridlib_tlb::IAppearancePtr var_Appearance = Grid1->VisualAppearance;
var_Appearance->Add(2,TVariant("c:\\exontrol\\images\\normal.ebn"));
var_Appearance->Add(1,TVariant("CP:2 10 3 -10 -5"));
Grid1->SelBackColor = Grid1->BackColor;
Grid1->SelForeColor = Grid1->ForeColor;
Grid1->ScrollBySingleLine = true;
Grid1->TreeColumnIndex = -1;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"Test");
var_Column->Width = 32;
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"RGB");
Exgridlib_tlb::IEditorPtr var_Editor = var_Column1->Editor;
var_Editor->EditType = Exgridlib_tlb::EditTypeEnum::SliderType;
var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exSliderMax,TVariant(255));
var_Editor->set_Option(Exgridlib_tlb::EditorOptionEnum::exSliderWidth,TVariant(-60));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant(""));
var_Items->set_CellHAlignment(TVariant(h),TVariant(0),Exgridlib_tlb::AlignmentEnum::CenterAlignment);
var_Items->set_ItemDivider(h,0);
var_Items->set_ItemBackColor(h,0x1000000);
var_Items->set_ItemHeight(h,36);
var_Items->set_SelectableItem(h,false);
h = var_Items->InsertItem(0,TVariant(1),TVariant("Red"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(255));
h = var_Items->InsertItem(0,TVariant(255),TVariant("Green"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(255));
h = var_Items->InsertItem(0,TVariant(65536),TVariant("Blue"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant(255));
Grid1->EndUpdate();
|
617
|
I know this is fairly basic, but could you send me a sample that places a tree in the first column

Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"heading");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Parent 1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child A"));
var_Items->InsertItem(var_Items->InsertItem(h,TNoParam(),TVariant("Child B")),TNoParam(),TVariant("GrandChild C"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("Parent 2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child D"));
var_Items->InsertItem(h,TNoParam(),TVariant("Child E"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
616
|
How can I get the caption of focused item
// SelectionChanged event - Fired after a new item has been selected.
void __fastcall TForm1::Grid1SelectionChanged(TObject *Sender)
{
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
OutputDebugString( L"Handle" );
OutputDebugString( PChar(var_Items->FocusItem) );
OutputDebugString( L"Caption" );
OutputDebugString( var_Items->get_CellCaption(TVariant(var_Items->FocusItem),TVariant(0)) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("R2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
615
|
How can I get the caption of selected item
// SelectionChanged event - Fired after a new item has been selected.
void __fastcall TForm1::Grid1SelectionChanged(TObject *Sender)
{
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
OutputDebugString( L"Handle" );
OutputDebugString( PChar(var_Items->get_SelectedItem(0)) );
OutputDebugString( L"Caption" );
OutputDebugString( var_Items->get_CellCaption(TVariant(var_Items->get_SelectedItem(0)),TVariant(0)) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("R2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
614
|
Is it possible to let users selects cells as in Excel

Grid1->BeginUpdate();
Grid1->FullRowSelect = Exgridlib_tlb::CellSelectEnum::exRectSel;
Grid1->SingleSel = false;
Grid1->ReadOnly = Exgridlib_tlb::ReadOnlyEnum::exReadOnly;
Grid1->MarkSearchColumn = false;
Grid1->ShowFocusRect = false;
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->SelForeColor = RGB(0,0,0);
Grid1->SelBackColor = RGB(200,225,242);
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"A");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"B");
var_Column->AllowSizing = false;
var_Column->Width = 24;
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"C");
var_Column1->AllowSizing = false;
var_Column1->Width = 24;
var_Column1->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasCheckBox,TVariant(1));
var_Column1->PartialCheck = true;
Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"D");
var_Column2->AllowSizing = false;
var_Column2->Width = 24;
var_Column2->set_Def(Exgridlib_tlb::DefColumnEnum::exCellHasRadioButton,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 1"));
long h1 = var_Items->InsertItem(h,TNoParam(),TVariant(16));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(17));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(11));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant(2));
var_Items->set_ItemBackColor(h1,RGB(240,240,240));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(9));
var_Items->set_ExpandItem(h,true);
h = var_Items->InsertItem(TNoParam(),TNoParam(),TVariant("Group 2"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(2),Exgridlib_tlb::ValueFormatEnum::exHTML);
h1 = var_Items->InsertItem(h,TNoParam(),TVariant(16));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(9));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant(12));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(11));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_ExpandItem(h,true);
var_Items->set_SelectItem(h,true);
Grid1->EndUpdate();
|
613
|
Is it possible to change the style for the vertical or horizontal grid lines, in the list area

Grid1->BeginUpdate();
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
Grid1->GridLineStyle = Exgridlib_tlb::GridLinesStyleEnum::exGridLinesVSolid | Exgridlib_tlb::GridLinesStyleEnum::exGridLinesHDot4;
Grid1->Columns->Add(L"C1");
Grid1->Columns->Add(L"C2");
Grid1->Columns->Add(L"C3");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Item 1"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("SubItem 1.2"));
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("SubItem 1.3"));
h = var_Items->AddItem(TVariant("Item 2"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("SubItem 2.2"));
var_Items->set_CellValue(TVariant(h),TVariant(2),TVariant("SubItem 2.3"));
Grid1->EndUpdate();
|
612
|
Is it possible to change the style for the grid lines, for instance to be solid not dotted

Grid1->BeginUpdate();
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
Grid1->GridLineStyle = Exgridlib_tlb::GridLinesStyleEnum::exGridLinesSolid;
Grid1->Columns->Add(L"Column");
Grid1->EndUpdate();
|
611
|
I have some buttons added on the control's scroll bar, how can I can know when the button is being clicked

// ScrollButtonClick event - Occurs when the user clicks a button in the scrollbar.
void __fastcall TForm1::Grid1ScrollButtonClick(TObject *Sender,Exgridlib_tlb::ScrollBarEnum ScrollBar,Exgridlib_tlb::ScrollPartEnum ScrollPart)
{
OutputDebugString( L"ScrollBar" );
OutputDebugString( L"ScrollPart" );
}
Grid1->ScrollPartVisible[Exgridlib_tlb::ScrollBarEnum::exHScroll,Exgridlib_tlb::ScrollPartEnum::exLeftB1Part] = true;
Grid1->ScrollPartVisible[Exgridlib_tlb::ScrollBarEnum::exHScroll,Exgridlib_tlb::ScrollPartEnum::exLeftB2Part] = true;
Grid1->ScrollPartVisible[Exgridlib_tlb::ScrollBarEnum::exHScroll,Exgridlib_tlb::ScrollPartEnum::exRightB6Part] = true;
Grid1->ScrollPartVisible[Exgridlib_tlb::ScrollBarEnum::exHScroll,Exgridlib_tlb::ScrollPartEnum::exRightB5Part] = true;
Grid1->ScrollBars = Exgridlib_tlb::ScrollBarsEnum::exDisableNoHorizontal;
|
610
|
How do I get notified once the user clicks a hyperlink created using the anchor HTML tag

// AnchorClick event - Occurs when an anchor element is clicked.
void __fastcall TForm1::Grid1AnchorClick(TObject *Sender,BSTR AnchorID,BSTR Options)
{
OutputDebugString( L"AnchorID" );
OutputDebugString( L"Options" );
}
Grid1->Columns->Add(L"Default")->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->AddItem(TVariant("This is a link: <aex.com;1>www.exontrol.com</a>"));
var_Items->AddItem(TVariant("This is a link: <aex.net;2>www.exontrol.net</a>"));
|
609
|
Is it possible to start editing a cell when double click it

// DblClick event - Occurs when the user dblclk the left mouse button over an object.
void __fastcall TForm1::Grid1DblClick(TObject *Sender,short Shift,int X,int Y)
{
Grid1->Edit(TNoParam());
}
Grid1->BeginUpdate();
Grid1->AutoEdit = false;
Grid1->MarkSearchColumn = false;
Grid1->Columns->Add(L"Edit1")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Grid1->Columns->Add(L"Edit2")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(1))),TVariant(1),TVariant(2));
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(3))),TVariant(1),TVariant(4));
Grid1->EndUpdate();
|
608
|
Is it possible to disable standard single-click behavior for this column, so I manually could call Edit() when needed

// DblClick event - Occurs when the user dblclk the left mouse button over an object.
void __fastcall TForm1::Grid1DblClick(TObject *Sender,short Shift,int X,int Y)
{
Grid1->Edit(TNoParam());
}
Grid1->BeginUpdate();
Grid1->AutoEdit = false;
Grid1->MarkSearchColumn = false;
Grid1->Columns->Add(L"Edit1")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Grid1->Columns->Add(L"Edit2")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(1))),TVariant(1),TVariant(2));
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(3))),TVariant(1),TVariant(4));
Grid1->EndUpdate();
|
607
|
How can I get or restore the old or previously value for the cell being changed
// Change event - Occurs when the user changes the cell's content.
void __fastcall TForm1::Grid1Change(TObject *Sender,Exgridlib_tlb::HITEM Item,long ColIndex,Variant * NewValue)
{
OutputDebugString( L"Old-Value:" );
OutputDebugString( PChar(Grid1->Items->get_CellValue(TVariant(Item),TVariant(ColIndex))) );
OutputDebugString( L"New-Value:" );
OutputDebugString( L"NewValue" );
}
Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Grid1->Columns->Add(L"Edit1")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Grid1->Columns->Add(L"Edit2")->Editor->EditType = Exgridlib_tlb::EditTypeEnum::EditType;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
var_Items->set_CellValue(TVariant(var_Items->AddItem(TVariant(1))),TVariant(1),TVariant(2));
Exgridlib_tlb::IItemsPtr var_Items1 = Grid1->Items;
var_Items1->set_CellValue(TVariant(var_Items1->AddItem(TVariant(3))),TVariant(1),TVariant(4));
Grid1->EndUpdate();
|
606
|
How can I get the item from the cursor
// MouseMove event - Occurs when the user moves the mouse.
void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y)
{
long h = Grid1->ItemFromPoint[-1,-1,c,hit];
OutputDebugString( L"Handle" );
OutputDebugString( L"h" );
OutputDebugString( L"Index" );
OutputDebugString( PChar(Grid1->Items->get_ItemToIndex(h)) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exHLines;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("R2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
605
|
How can I get the column from the cursor, not only in the header

// MouseMove event - Occurs when the user moves the mouse.
void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y)
{
OutputDebugString( PChar(Grid1->ColumnFromPoint[-1,0]) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"P1");
Grid1->Columns->Add(L"P2");
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("R2"));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"))),TVariant(1),TVariant("Cell 1.2"));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"))),TVariant(1),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
604
|
How can I get the column from the cursor

// MouseMove event - Occurs when the user moves the mouse.
void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y)
{
OutputDebugString( PChar(Grid1->ColumnFromPoint[-1,-1]) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->DrawGridLines = Exgridlib_tlb::GridLinesEnum::exAllLines;
Grid1->Columns->Add(L"P1");
Grid1->Columns->Add(L"P2");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->set_CellValue(TVariant(h),TVariant(1),TVariant("R2"));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"))),TVariant(1),TVariant("Cell 1.2"));
var_Items->set_CellValue(TVariant(var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"))),TVariant(1),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
603
|
How can I get the cell's caption from the cursor
// MouseMove event - Occurs when the user moves the mouse.
void __fastcall TForm1::Grid1MouseMove(TObject *Sender,short Button,short Shift,int X,int Y)
{
long h = Grid1->ItemFromPoint[-1,-1,c,hit];
OutputDebugString( Grid1->Items->get_CellCaption(TVariant(h),TVariant(c)) );
}
Grid1->BeginUpdate();
Grid1->LinesAtRoot = Exgridlib_tlb::LinesAtRootEnum::exLinesAtRoot;
Grid1->Columns->Add(L"Items");
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("R1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 1.2"));
var_Items->set_ExpandItem(h,true);
h = var_Items->AddItem(TVariant("R2"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.1"));
var_Items->InsertItem(h,TNoParam(),TVariant("Cell 2.2"));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
602
|
How can I customize the items based on the values in the cells

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IConditionalFormatsPtr var_ConditionalFormats = Grid1->ConditionalFormats;
Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat = var_ConditionalFormats->Add(L"%1 >4",TNoParam());
var_ConditionalFormat->Bold = true;
var_ConditionalFormat->StrikeOut = true;
var_ConditionalFormat->ForeColor = RGB(255,0,0);
var_ConditionalFormat->ApplyTo = Exgridlib_tlb::FormatApplyToEnum::exFormatToItems;
Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat1 = var_ConditionalFormats->Add(L"%2 > 4",TNoParam());
var_ConditionalFormat1->Bold = true;
var_ConditionalFormat1->StrikeOut = true;
var_ConditionalFormat1->ForeColor = RGB(255,0,0);
var_ConditionalFormat1->ApplyTo = Exgridlib_tlb::FormatApplyToEnum(0x2);
Exgridlib_tlb::IConditionalFormatPtr var_ConditionalFormat2 = var_ConditionalFormats->Add(L"%3 > 4",TNoParam());
var_ConditionalFormat2->Bold = true;
var_ConditionalFormat2->StrikeOut = true;
var_ConditionalFormat2->ForeColor = RGB(255,0,0);
var_ConditionalFormat2->ApplyTo = Exgridlib_tlb::FormatApplyToEnum(0x3);
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"A");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column->AllowSizing = false;
var_Column->Width = 36;
var_Column->FormatColumn = L"len(value) ? value + ' +'";
var_Column->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"B");
var_Column1->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column1->AllowSizing = false;
var_Column1->Width = 36;
var_Column1->FormatColumn = L"len(value) ? value + ' +'";
var_Column1->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"C");
var_Column2->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column2->AllowSizing = false;
var_Column2->Width = 36;
var_Column2->FormatColumn = L"len(value) ? value + ' ='";
var_Column2->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column3 = var_Columns->Add(L"A+B+C");
var_Column3->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column3->AllowSizing = false;
var_Column3->Width = 64;
var_Column3->ComputedField = L"%1+%2+%3";
var_Column3->FormatColumn = L"((0:=dbl(value)) < 10? '<fgcolor=808080><font ;7>' :'<b>') + currency(=:0)";
var_Column3->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(4),Exgridlib_tlb::ValueFormatEnum::exComputedField);
long h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(7));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(3));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(1));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(5));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(12));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(4));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 4"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(9));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(4));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|
601
|
Is it is possible to have a column computing values from other columns

Grid1->BeginUpdate();
Grid1->MarkSearchColumn = false;
Exgridlib_tlb::IColumnsPtr var_Columns = Grid1->Columns;
var_Columns->Add(L"Name");
Exgridlib_tlb::IColumnPtr var_Column = var_Columns->Add(L"A");
var_Column->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column->AllowSizing = false;
var_Column->Width = 36;
var_Column->FormatColumn = L"len(value) ? value + ' +'";
var_Column->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column1 = var_Columns->Add(L"B");
var_Column1->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column1->AllowSizing = false;
var_Column1->Width = 36;
var_Column1->FormatColumn = L"len(value) ? value + ' +'";
var_Column1->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column2 = var_Columns->Add(L"C");
var_Column2->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column2->AllowSizing = false;
var_Column2->Width = 36;
var_Column2->FormatColumn = L"len(value) ? value + ' ='";
var_Column2->Editor->EditType = Exgridlib_tlb::EditTypeEnum::SpinType;
Exgridlib_tlb::IColumnPtr var_Column3 = var_Columns->Add(L"A+B+C");
var_Column3->SortType = Exgridlib_tlb::SortTypeEnum::SortNumeric;
var_Column3->AllowSizing = false;
var_Column3->Width = 64;
var_Column3->ComputedField = L"%1+%2+%3";
var_Column3->FormatColumn = L"((0:=dbl(value)) < 10? '<fgcolor=808080><font ;7>' :'<b>') + currency(=:0)";
var_Column3->set_Def(Exgridlib_tlb::DefColumnEnum::exCellValueFormat,TVariant(1));
Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items;
long h = var_Items->AddItem(TVariant("Root"));
var_Items->set_CellValueFormat(TVariant(h),TVariant(4),Exgridlib_tlb::ValueFormatEnum::exComputedField);
long h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 1"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(7));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(3));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(1));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 2"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(5));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(12));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 3"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(4));
h1 = var_Items->InsertItem(h,TNoParam(),TVariant("Child 4"));
var_Items->set_CellValue(TVariant(h1),TVariant(1),TVariant(2));
var_Items->set_CellValue(TVariant(h1),TVariant(2),TVariant(9));
var_Items->set_CellValue(TVariant(h1),TVariant(3),TVariant(4));
var_Items->set_ExpandItem(h,true);
Grid1->EndUpdate();
|